package c07_change_canshu;

public class Test {


    public static void test(int ... a ) {
        int sum=0;
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
        System.out.println("sum"+sum);
        System.out.println("------------------");
    }
    public static void main(String[] args) {
        test(1,2,19,4,5,6,7,8,9,10,11,12,13,14,15,16);

    }
}
/*public class Test {
I*
定义方法：接收任意个整型数据
*1
//int[] a
宓∨
public static void test(int ... a ){ 5usages
//注意：一个形参列表中可变参数只能有一个
//注意：可变参数必须放在最后
//System.out.println(a.length);
//System.out.printin(Arrays.toString(a));
int sum = 0;
for (int i = 0; i < a.length; i++) {
SUm += a[il;
System.out.printin("sum="+sum);
傢∨
public static void main(String[] args) {
testO:
test .a. 1);
test( ..a: 1,2);
test( .a: 1,2,3);
test(/a:/1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6);*/